<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
<title>设备信息管理</title>

<link href="${pageContext.request.contextPath }/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/font-awesome.css?v=4.4.0" rel="stylesheet">

<link href="${pageContext.request.contextPath }/css/plugins/iCheck/custom.css" rel="stylesheet">

<!-- Sweet Alert -->
<link href="${pageContext.request.contextPath }/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">


<link href="${pageContext.request.contextPath }/css/animate.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/style.css?v=4.1.0" rel="stylesheet">


<link href="${pageContext.request.contextPath }/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/plugins/toastr/toastr.min.css" rel="stylesheet">
	
			
<link href="${pageContext.request.contextPath }/myCss/common.css" rel="stylesheet">
</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<!-- 客户信息管理 -->
			<div class="col-sm-12">
				<div class="ibox">
					<div class="ibox-content">
						<div class="tab-content">
							<div id="deviceToolbar">
								<span class="small text-center">
									<button class="btn btn-xs btn-primary" onclick="addDevice()">
										<i class="fa fa-plus"></i> 新增设备
									</button>
								</span>
								<span class="small text-center">
									<button class="btn btn-xs btn-info" onclick="updateDeviceParam()">
										<i class="fa fa-edit"></i> 修改参数
									</button>
								</span>
								 <span class="small text-center">
									<button class="btn btn-xs btn-danger" onclick="batchDelete()">
										<i class="fa fa-remove"></i> 批量删除
									</button>
								</span>
							</div>
							<h2>设备管理</h2>
							<div class="alert alert-info alert-dismissable">
								<button aria-hidden="true" data-dismiss="alert" class="close"
									type="button">×</button>
								双击行可以查看设备详细信息
							</div>
							<div class="">
								<div class="tab-pane active">
									<div class="table-responsive"></div>
									<!-- 动态生成表格 -->
									<table id="deviceTable">
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>



	</div>

	<!-- 新增设备的弹出框 -->
	<div class="modal inmodal" id="addDeviceModal" tabindex="-1"
		device="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 700px; margin: 0 auto">
			<div class="modal-content animated fadeIn">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title">新增设备</h4>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="ibox float-e-margins">
							<div class="ibox-content">
								<form class="form-horizontal" id="addDeviceForm">
									<div class="form-group">
										<label class="col-sm-4 control-label">设备名称：</label>
										<div class="col-sm-6">
											<input name="deviceName" class="form-control input-sm">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label">售后服务号：</label>
										<div class="col-sm-6">
											<input name="deviceServiceNumber" class="form-control input-sm">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label">所属类别：</label>
										<div class="col-sm-6" id="bsSuggestArea">
										</div>
									</div>
									<div id="paramsOfAddDevice">
										
									</div>
									<div class="form-group">
		                                <label class="col-sm-4  control-label">设备图片</label>
		                                <div class="col-sm-6">
		                                	<input type="file" class="prettyFileInput" name="deviceImg">
										</div>
		                            </div>
									<div class="form-group">
										<label class="col-sm-4 control-label">设备描述：</label>
										<div class="col-sm-6">
											<textarea class="form-control" name="deviceDesc"></textarea>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" onclick="addDeviceSave()">保存</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 新增客户的弹出框结束 -->
	
	
	<!-- 设备详情弹出框开始 -->
    <div class="modal inmodal fade" id="deviceDetailModal" tabindex="-1"
				role="dialog" aria-hidden="true">
		<div class="modal-dialog"><!-- modal-lg -->
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title">设备详情</h4>
				</div>
				<div class="modal-body">
					<div class="row">
						<div class="col-sm-12">
							<div class="col-sm-1"></div>
							<div class="col-sm-10" id="deviceDetailShow">
							
							</div>
						</div>
					</div>
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 设备详情弹出框结束 -->
	
	<!-- 更新书籍图片的弹出框 -->
	<div class="modal inmodal" id="updateDeviceImgModal" tabindex="-1"
		book="dialog" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content animated fadeIn">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title">更新图片</h4>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="ibox float-e-margins">
							<div class="ibox-content">
								<form class="form-horizontal" id="updateDeviceImgForm" enctype="mutipart/form-data">
									<input hidden="hidden" name="id" />
									<div class="form-group">
		                                <label class="col-sm-4  control-label">设备图片</label>
		                                <div class="col-sm-6">
		                                	<input  type="file" class="prettyFileInput" name="deviceImg">
										</div>
		                            </div>
								</form>
							</div>
						</div>
					</div>
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" onclick="updateDeviceImgSave()">保存</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 更新书籍图片的弹出框结束 -->
	
	
	<!-- 修改客户的弹出框开始 -->
	<div class="modal inmodal" id="updateDeviceModal" tabindex="-1"
		device="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 700px; margin: 0 auto">
			<div class="modal-content animated fadeIn">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title">修改设备</h4>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="ibox float-e-margins">
							<div class="ibox-content">
								<form class="form-horizontal" id="updateDeviceForm" >
									<input type="hidden"  name="id" />
									<div class="form-group">
										<label class="col-sm-4 control-label">设备名称：</label>
										<div class="col-sm-6">
											<input name="deviceName" class="form-control input-sm">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label">售后服务号：</label>
										<div class="col-sm-6">
											<input name="deviceServiceNumber" class="form-control input-sm">
										</div>
									</div>
										
									<div class="form-group">
										<label class="col-sm-4 control-label">设备描述：</label>
										<div class="col-sm-6">
											<textarea class="form-control" name="deviceDesc"></textarea>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" onclick="updateDeviceSave()">保存</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 修改设备信息的弹出框结束 -->

	<!-- 设备详情信息弹出框开始 -->
	<div class="modal inmodal fade" id="deviceInfo" tabindex="-1"
		device="dialog" aria-hidden="true">
		<div class="modal-dialog ">
			<!-- modal-lg -->
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title">设备详情</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal">
						<div class="form-group">
							<label class="col-sm-4 control-label">设备名：</label>
							<div class="col-sm-6">
								<p name="deviceName" class="form-control input-sm"
									style="background: #f8fafb; border: 0px solid #0000FF;"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">设备型号：</label>
							<div class="col-sm-6">
								<p name="deviceModel" class="form-control input-sm"
									style="background: #f8fafb; border: 0px solid #0000FF;"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">设备服务号：</label>
							<div class="col-sm-6">
								<p name="deviceServiceNumber" class="form-control input-sm"
									style="background: #f8fafb; border: 0px solid #0000FF;"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">设备类别：</label>
							<div class="col-sm-6">
								<p name="categoryId" class="form-control input-sm"
									style="background: #f8fafb; border: 0px solid #0000FF;"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">设备图片：</label>
							<div class="col-sm-6">
								<div class="img-preview img-preview-sm"
									style="border: 1px solid #e5e6e7;">
									<img src="" id="deviceImage" class="img-preview img-preview-sm">
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">设备描述：</label>
							<div class="col-sm-6">
								<p name="deviceDesc" class="form-control input-sm"
									style="background: #f8fafb; border: 0px solid #0000FF; height: 130px"></p>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<!-- 设备详情信息弹出框完毕 -->
	<!-- 全局js -->
	<script
		src="${pageContext.request.contextPath }/js/jquery.min.js?v=2.1.4"></script>
	<script
		src="${pageContext.request.contextPath }/js/bootstrap.min.js?v=3.3.6"></script>


	<!-- iCheck -->
	<script
		src="${pageContext.request.contextPath }/js/plugins/iCheck/icheck.min.js"></script>
	<script>
		$(document).ready(function() {
			$('.i-checks').iCheck({
				checkboxClass : 'icheckbox_square-green',
				radioClass : 'iradio_square-green',
			});
		});
	</script>

	<!-- bootstr表格插件 -->
	<script
		src="${pageContext.request.contextPath }/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

	<!-- 表单验证插件   -->
	<script
		src="${pageContext.request.contextPath }/js/plugins/validate/jquery.validate.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/plugins/validate/messages_zh.min.js"></script>


	<!-- 通知插件 -->
	<script
		src="${pageContext.request.contextPath }/js/plugins/sweetalert/sweetalert.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/plugins/toastr/toastr.min.js"></script>

	<!-- 格式化时间 -->
	<script src="${pageContext.request.contextPath }/js/plugins/moment.js"></script>
		
	<!-- 搜索建议 -->
	<script src="${pageContext.request.contextPath }/js/plugins/suggest/bootstrap-suggest.min.js"></script>
	 
	<!-- Prettyfile -->
    <script src="${pageContext.request.contextPath }/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
    <script>
        $(".prettyFileInput").prettyFile();
    </script>
    
	<script src="${pageContext.request.contextPath }/myJs/common.js"></script>
	<script src="${pageContext.request.contextPath }/myJs/info/device/device.js"></script>
	
	<!-- 上传图片预览 -->
</body>

</html>
